<template>
  <dl class="fly-panel fly-list-one">
    <dt class="fly-panel-title">本周热议</dt>
    <dd v-for="item in list" :key="item.id">
      <a :href="item.link">{{ item.title }}</a>
      <span><i class="iconfont icon-pinglun1"></i> {{ item.answer }}</span>
    </dd>

    <!-- 无数据时 -->
    <!--
        <div class="fly-none">没有相关数据</div>
        -->
  </dl>
</template>

<script>
import { getTop } from '@/api/comtent'
export default {
  name: 'hot-talk',
  data () {
    return {
      list: []
    }
  },
  created () {
    this._getTop()
  },
  methods: {
    _getTop () {
      getTop().then((result) => {
        if (result.code === 200) {
          this.list = result.data
        }
      }).catch((err) => {
        console.log(err)
      })
    }
  }
}
</script>
